package lab02.test34;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by dell on 2017/11/21.
 */
public class Test34 {
    public static void main(String[] args) {
        List<String> list =new ArrayList<String>();

        //存储以下元素：apple, grape, banana, pear
        list.add("apple");
        list.add("grape");
        list.add("banana");
        list.add("pear");

        Object[] objects= list.toArray();

        //输出最大的和最小的元素
        System.out.println("最小值:"+objects[0]);
        System.out.println("最大值:"+objects[objects.length-1]);

        for(Object o:objects){
            System.out.println(o);
        }


    }

}

